<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta charset="utf-8" />
    <title>&copy;云多科技</title>

	<meta name="description" content="Draggabble Widget Boxes &amp; Containers" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

	<!-- bootstrap & fontawesome -->
	<link rel="stylesheet" href="assets/css/bootstrap.css" />
	<link rel="stylesheet" href="assets/css/font-awesome.css" />

	<!-- ace styles -->
	<link rel="stylesheet" href="assets/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />

</head>

<body class="no-skin">

<div class="col-xs-12 col-sm-6 widget-container-col">
	<div class="widget-box widget-color-blue">

		<!-- /section:custom/widget-box.options -->
		<div class="widget-body">
			<div class="widget-main no-padding">
				<table class="table table-striped table-bordered table-hover">

					<tbody>
					<tr>
						<td class="">客户</td>

						<td>
							<a href="#"><span th:text="${clientname}"/></a>

						</td>
					</tr>
					<tr>
						<td class="">客户地址</td>

						<td>
							<a href="#"><span th:text="${clientaddress}"/></a>

						</td>
					</tr>
					<tr>
						<td class="">项目名称</td>

						<td>
							<a href="#"><span th:text="${projectname}"/></a>
						</td>

					</tr>

					<tr>
						<td class="">优先级</td>

						<td>
							<a href="#"><span th:text="${projectpriority}"/></a>
						</td>

					</tr>

					<tr>
						<td class="">接修日期</td>

						<td>
							<a href="#"><span th:text="${reporttime}"/></a>
						</td>
					</tr>
					<tr>
						<td class="">预约时间</td>

						<td>
							<a href="#"><span th:text="${plantime}"/></a>
						</td>
					</tr>
					<tr>
						<td class="">任务类型</td>

						<td>
							<a href="#"><span th:text="${tasktype}"/></a>
						</td>
					</tr>
					<tr>
						<td class="">状态</td>

						<td>
							<a href="#"><span th:text="${taskstatus}"/></a>
						</td>
					</tr>
					<tr>
						<td class="" style="white-space: nowrap">故障描述</td>

						<td style="word-break:break-all">
							<a href="#"><span th:text="${issuedesc}"/></a>
						</td>
					</tr>
					<tr>
						<td class=""></td>

						<td>
							<a href="#"></a>
						</td>
					</tr>
					<tr>
						<td class="">派遣员工</td>

						<td>
							<a href="#"><span th:text="${assignee}"/></a>
						</td>
					</tr>
					<tr>
						<td class="">上门日期</td>

						<td>
							<a id="arrivetime" href="#"><span th:text="${arrivaltime}"/></a>
						</td>
					</tr>
					<tr>
						<td class="">调度日期</td>

						<td>
							<a href="#"><span th:text="${dispatchtime}"/></a>
						</td>
					</tr>
					<tr>
						<td class="">签到状态</td>
						<td >
							<a id="checkinstatus" href="#"><span th:text="${arrivalcheckin}"/></a>
						</td>
					</tr>
					</tbody>
				</table>

			</div>


		</div>

	</div>
	<div class="space"></div>
	<p id="eventid_div" style="display: none" ><span th:text="${eventid}"/></p>
	<button id="checkin_btn" class="btn btn-primary btn-block">签到</button>
	<div class="space"></div>
</div>

<div class="space"></div>
</body>
<script src="assets/js/jquery.js"></script>
<script  type="text/javascript">
	function InitArrivalStatus() {
		if ($('#checkinstatus').text() == "yes") {
			checkinBtnHide();
		}
		else{
			checkinBtnShow();
		}
	}
	function checkinBtnShow(){
		$("#checkinstatus").html("未签到");
		$("#checkin_btn").show();
	}
	function checkinBtnHide(){
		$("#checkinstatus").html("已签到");
		$("#checkin_btn").hide();
	}
	$(document).ready(function(){
		InitArrivalStatus();
		$("#checkin_btn").click(function(){
			_eventid=$("#eventid_div").text();
			$.ajax({
				url: "ajaxcheckin",
				type: "POST",
				data: {eventid: _eventid},
				dataType: "json",
				async: false,
				success: function(data){
					if (data.retcode == 0){
						checkinBtnHide();
						$("#arrivetime").html(data.checkintime);
					}
					else{
						checkinBtnShow();
					}
				}
			});
		});
	});
</script>
</html>
